From 9bb2490c4d85563f684fcd94b9a42532b91d09d6 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 16 Dec 2014 09:18:40 -0800 Subject: [PATCH] Fix mac nightly builds Older versions of curl apparently don't peel off the query parameters when looking up filenames, so make two copies of the search results file in hope that curl will find one of them! --- tests/test_cargo_search.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/test_cargo_search.rs b/tests/test_cargo_search.rs index 83cebb433..c2cf6a705 100644 --- a/tests/test_cargo_search.rs +++ b/tests/test_cargo_search.rs @@ -39,8 +39,7 @@ fn cargo_process(s: &str) -> ProcessBuilder { } test!(simple { - let crates = api_path().join("api/v1/crates"); - File::create(&crates).write_str(r#"{ + let contents = r#"{ "crates": [{ "created_at": "2014-11-16T20:17:35Z", "description": "Design by contract style assertions for Rust", @@ -65,7 +64,19 @@ test!(simple { "meta": { "total": 1 } - }"#).assert(); + }"#; + let base = api_path().join("api/v1/crates"); + + // Older versions of curl don't peel off query parameters when looking for + // filenames, so just make both files. + // + // On windows, though, `?` is an invalid character, but we always build curl + // from source there anyway! + File::create(&base).write_str(contents).unwrap(); + if !cfg!(windows) { + File::create(&base.with_filename("crates?q=postgres")) + .write_str(contents).unwrap(); + } assert_that(cargo_process("search").arg("postgres"), execs().with_status(0).with_stdout(format!("\ -- 2.30.2